package com.rainbow.gray.framework.utils;

import org.apache.commons.lang3.StringUtils;

import com.rainbow.gray.framework.constant.GrayConstant;

public class StrategyUtil {
    public static boolean isCoreHeaderContains(String headerName) {
        return StringUtils.equals(headerName, GrayConstant.N_D_VERSION) ||
                StringUtils.equals(headerName, GrayConstant.N_D_REGION) ||
                StringUtils.equals(headerName, GrayConstant.N_D_ADDRESS) ||
                StringUtils.equals(headerName, GrayConstant.N_D_VERSION_WEIGHT) ||
                StringUtils.equals(headerName, GrayConstant.N_D_REGION_WEIGHT) ||
                StringUtils.equals(headerName, GrayConstant.N_D_ID_BLACKLIST) ||
                StringUtils.equals(headerName, GrayConstant.N_D_ADDRESS_BLACKLIST);
    }

    public static boolean isInnerHeaderContains(String headerName) {
        return StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_GROUP) ||
                StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_TYPE) ||
                StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_APP_ID) ||
                StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_ID) ||
                StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_ADDRESS) ||
                StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_VERSION) ||
                StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_REGION) ||
                StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_ENVIRONMENT) ||
                StringUtils.equals(headerName, GrayConstant.N_D_SERVICE_ZONE);
    }
}
